<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>{block name="title"}个人博客{/block}</title>
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
    <link rel="stylesheet" href="__INDEX__/css/bootstrap.min.css" />
    <link rel="stylesheet" href="__INDEX__/css/animate.css" />
    <link rel="stylesheet" href="__INDEX__/css/index.css" />
    <link rel="stylesheet" href="__STATIC__/lib/layui/css/layui.css" />
</head>
<body>
<nav class="navbar navbar-inverse navbar-static-top">
    <div class="container">
        <div class="navbar-header">
            <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-menu">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a href="{:url('index/index/index')}" class="navbar-brand">个人博客</a>
        </div>
        <div class="navbar-menu collapse navbar-collapse">
            <ul class="nav navbar-nav navbar-left">
                <li><a href="{:url('index/index/index')}">首页</a></li>
                {volist name="cates" id="vo"}
                <li><a href="{:url('index/index/index', ['id'=>$vo.id])}">{$vo.catename}</a></li>
                {/volist}
            </ul>
            <ul class="nav navbar-nav navbar-right">
                {if Session::has('userInfo')}
                <li><a href="#">{:Session::get('userInfo.nickname')}</a></li>
                <li><a href="{:url('index/index/loginout')}">退出</a></li>
                {else /}
                <li><a href="{:url('index/index/login')}">登录</a></li>
                <li><a href="{:url('index/index/register')}">注册</a></li>
                {/if}
                <li><a href="#" id="contribute">投稿</a></li>
            </ul>
            <form action="{:url('index/index/search')}" class="navbar-form navbar-right" method="get">
                <div class="form-group">
                    <input type="text" class="form-control input-sm" id="search" name="keyword" placeholder="搜索" />
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-default btn-sm">搜索</button>
                </div>
            </form>
        </div>
    </div>
</nav>
{block name="content"}
{/block}
{block name="footer"}
<div class="footer" style="width: 100%;position: fixed;bottom: 0px;">
    <p>Copyright 2021 <a href="#">{$webInfo.copyright}</a> All Rights Reserved</p>
</div>
{/block}

<script src="__INDEX__/js/jquery-3.3.1.min.js"></script>
<script src="__INDEX__/js/bootstrap.min.js"></script>
<script src="__STATIC__/lib/layer/layer.js"></script>
<script>
    $(function () {
        $('#contribute').click(function () {
            if ("{:Session::has('userInfo')}") {
                location.href = "{:url('index/contribution/contriadd')}";
            }else {
                layer.msg('请先登录！', {
                    icon: 5,
                    time: 2000
                });
            }
            return false;
        });
    });
</script>
{block name="js"}
{/block}
</body>
</html>